<?php
/*
iSuS - iScripting.net User System
v1.0 made by Panzer
http://www.iScripting.net
Copyright must stay intact
*/

//Permission check to see if the user can view profiles
if($userCan['viewprofile']) {

//If the user hasn't selected a user's profile to view..
if(!$_GET[user]) {
//Select all the users
$getuser = mysql_query("SELECT * FROM users ORDER BY id ASC");

//And echo out all their names with links to their profiles
while ($user = mysql_fetch_array($getuser)) {

echo "<a href='index.php?action=memberlist&user=$user[username]'>$user[username]</a><br />";

}

}
else
{
//They user has specified a user profile to view, secure it.
$secureduser = secure($_GET[user]);

//find the user in the database
$getuser = mysql_query("SELECT * FROM users WHERE username='$secureduser'");
$usernum = mysql_num_rows($getuser);
//If the user doesn't exist...
if ($usernum == 0) {

echo 'User not found';

}
//If the user does exist..
else
{
//Show their profile
$profile = mysql_fetch_array($getuser);

echo "<b>$profile[username]'s profile</b><br /><br />
		MSN Messenger:<i> $profile[msn]</i><br />
		AOL Messenger:<i> $profile[aim]</i><br />
		GTalk:<i> $profile[gtalk]</i><br />
		Location:<i> $profile[location]</i><br />
		Email:<i> $profile[email]</i><br />
		Bio: <i> $profile[bio] </i><br />
		";
	

}
}
} else {

echo 'You don\'t have permission to view this feature';
}
?>